package com.whyx.project.openapi.business;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 处置证下发
 */
@Data
public class HandleIssue extends DistributeEntity {
    /**
     * 消息ID
     * **/
    public Integer messageId;
    /**
     * ID
     * **/
    public Integer id;
    /**
     * 操作类型:1 新增；2 删除；3 清空  (ID相同则修改)
     * **/
    public Integer operation;
    /**
     * 业务值
     * **/
    public Integer businessValue;
    /**
     * 开始时间
     * **/
    public Date startTime;
    /**
     * 结束时间
     * **/
    public Date endTime;
    /**
     * 内容
     * **/
    public String content;

    public JSONObject toJSONString(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        JSONObject object = new JSONObject();
        object.put("messageId",messageId);
        object.put("id",id);
        object.put("operation",operation);
        object.put("businessValue",businessValue);
        object.put("startTime",sdf.format(startTime));
        object.put("endTime",sdf.format(endTime));
        object.put("content",content);
        object.put("distributeMsgTopic",distributeMsgTopic);
        object.put("msgId",msgId);
        object.put("devNo",devNo);
        object.put("requestId",requestId);
        object.put("userId",userId);
        object.put("userName",userName);
        object.put("distributeTime",sdf.format(distributeTime));
        object.put("serialNo",serialNo);
        return object;
    }


}
